package com.wang.demo.controller;

import com.wang.demo.service.IDemoService;
import com.wang.mvcframework.annotations.WangAutowired;
import com.wang.mvcframework.annotations.WangController;
import com.wang.mvcframework.annotations.WangRequestMapping;
import com.wang.mvcframework.annotations.WangSecurity;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by wangq on 2021/7/24.
 */
@WangController
@WangRequestMapping("/demo")
@WangSecurity(values = {"wang","zhang"})
public class DemoController {

    @WangAutowired
    private IDemoService iDemoService;

    @WangRequestMapping("/query")
    public String query(HttpServletRequest request, HttpServletResponse response, String name) {
        System.out.println("DemoController query...");
        return iDemoService.get(name);
    }

    @WangRequestMapping("/query1")
    @WangSecurity(values = {"li"})
    public String query1(HttpServletRequest request, HttpServletResponse response, String name) {
        System.out.println("DemoController query1...");
        return iDemoService.get(name);
    }
}
